<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN"> 
<head>
	<!-- INCLUDE meta.html -->
    <script src="js/common.js"></script>
  
  	<style type="text/css">
form
{
	border:0px;
	margin:0px;
	padding:0px;
}
#demo-status
{
	background-color:		#F9F7ED;
	padding:				10px 15px;
	/*width:					420px;*/
}

#demo-status .progress
{
	background:				white url(view/admin/images/progress.gif) no-repeat;
	background-position:	+50% 0;
	margin-right:			0.5em;
}

#demo-status .progress-text
{
	font-size:				0.9em;
	font-weight:			bold;
}

#demo-list
{
	list-style:				none;
	width:					99%;
	margin:					0;
	padding: 0px;
}


#demo-list li
{
	width:650px;
	height:30px;
}

#demo-list li.file .file-name
{
	width:350px;
	overflow:hidden;
	float:left;
	font-weight:bold;
	font-size:16px;
}
#demo-list li .file-uploading
{
	background-color:#FFFF99;
}
#demo-list li.file .file-remove
{
	float:right;
	margin-right:20px;
}
#demo-list li.file .file-size
{
	float:right;
	margin-right:20px;
}

.error-list
{
	color:#FF0000;
}
.file-list-title
{
	font-weight:bold;
	font-size:14px;
}
.error-list .error-item
{
	margin:2px;
}

	</style>
	<script type="text/javascript" src="js/mootools.js"></script>
	<script type="text/javascript" src="js/Swiff.Uploader.js"></script>
	<script type="text/javascript" src="js/Fx.ProgressBar.js"></script>
	<script type="text/javascript" src="js/FancyUpload2.js"></script>


  
  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body>
<div class='main'>

<div class="headerdiv">
	<!-- INCLUDE header.html -->
</div>
  
<div id='content'>
	<div id='left'>
    	<div style="margin:10px;margin-top:30px;">
        	<ul>
				
            </ul>
    		
        </div>
    </div>
    <div id='maindiv'>
    	<div class="description">
			{page_description}
        </div>

        <div class="real_content">
        	<form action="admin.php?p=photo_upload&m=save&PHPSID=<?php echo session_id();?>" method="post" enctype="multipart/form-data" id="form-demo" onsubmit="return false;" style="margin:0px;">
 
				<fieldset id="demo-fallback" style="display:none;">
					<legend>文件上传</legend>
					<label for="demo-photoupload">
						Upload Photos:
						<input type="file" name="photoupload" id="demo-photoupload" />
					</label>
				</fieldset>

				<div id="demo-status" class="hide">
					<p>
						<input type="button" id="demo-browse" value="浏览" />&nbsp;
						<input type="button" id="demo-clear" value="清空" />&nbsp;
						<input type="button" id="demo-upload" value="上传" />&nbsp;
					</p>
					<div>
						<strong class="overall-title">总体进度</strong><br />
						<img src="images/progress-bar/bar.gif" class="progress overall-progress" />
					</div>
					<div>
						<strong class="current-title">当前进度</strong><br />
						<img src="images/progress-bar/bar.gif" class="progress current-progress" />
					</div>
					<div class="current-text"></div>
				</div>
				<ul id="demo-list"></ul>
			</form>
        </div>
    </div>
</div>

<div class="footer">
Copyright @ <a href="http://longbill.cn" target="_blank">Longbill</a> ({time_used}s) ({total_query})
</div>

</div>
<script>
window.addEvent('load', function() {

	// For testing, showing the user the current Flash version.
	//document.getElement('h3 + p').appendText(' Detected Flash ' + Browser.Plugins.Flash.version + '!');
	//alert(' Detected Flash ' + Browser.Plugins.Flash.version + '!');
	var swiffy = new FancyUpload2($('demo-status'), $('demo-list'), {
		url: $('form-demo').action,
		fieldName: 'photoupload',
		path: 'js/uploader.swf',//'js/Swiff.Uploader.swf',
		limitSize: 200 * 1024 * 1024, // 200Mb
		onLoad: function() {
			$('demo-status').removeClass('hide');
			$('demo-fallback').destroy();
		},
		onComplete:function(file)
		{
			$(document.body).getElements('li.file').each(function(o)
			{
				$(o).getElements('.file-name').each(function(e)
				{
					if (e.innerHTML == file.name)
					{
						o.style.display = 'none';
					}
				});
			});
		},
		// The changed parts!
		debug: false, // enable logs, uses console.log
		target: 'demo-browse' // the element for the overlay (Flash 10 only)
	});

	/**
	 * Various interactions
	 */

	$('demo-browse').addEvent('click', function() {
		/**
		 * Doesn't work anymore with Flash 10: swiffy.browse();
		 * FancyUpload moves the Flash movie as overlay over the link.
		 * (see opeion "target" above)
		 */
		swiffy.browse();
		return false;
	});

	/**
	 * The *NEW* way to set the typeFilter, since Flash 10 does not call
	 * swiffy.browse(), we need to change the type manually before the browse-click.
	 */

	$('demo-clear').addEvent('click', function() {
		swiffy.removeFile();
		return false;
	});

	$('demo-upload').addEvent('click', function() {
		swiffy.upload();
		return false;
	});

});
</script>

</body>
</html>